package com.cx.mall.user.service.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.cx.mall.common.model.user.UserInfo;
import com.cx.mall.user.mapper.UserInfoMapper;
import com.cx.mall.user.service.IUserInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 后台用户表 服务实现类
 * </p>
 *
 * @author lyt
 * @since 2025-07-08
 */
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements IUserInfoService {

    @Override

    public UserInfo getUserInfoByUsername(String username) {
        //1、创建条件构造器
        LambdaQueryChainWrapper<UserInfo> wrapper = new LambdaQueryChainWrapper<>(baseMapper);
        //2、填充条件
        UserInfo one = wrapper.eq(UserInfo::getUsername, username).one();
        return one;
    }
}
